home *** CD-ROM | disk | FTP | other *** search
/ Software 2000 / Software 2000 Volume 1 (Disc 2 of 2).iso / demos / d049.dms / in.adf / mega2.s < prev    next >
Encoding:
Text File  |  1987-05-06  |  5.0 KB  |  240 lines

  1. * Sine Scroller by MARK (MATRIX) for soundtracker songs just 
  2. * add the source code)    
  3.     bsr start
  4.     move.l $4,a6
  5.     movem.l a0-a6/d0-d7,-(a7)
  6.     lea $dff000,a5
  7.     move.w #$83a0,150(a5)
  8.     move.w #$4000,154(a5)
  9.     move.l #$68000,$0108
  10.     move.l (a6),a0
  11.     move.l (a0),a0
  12.     move.l a0,$0100
  13.     move.l 38(a0),$104
  14.     lea copper(pc),a0
  15.     move.l a0,128(a5)
  16.     bsr clearscreen
  17.     bsr init2
  18.     bsr init3
  19. vposr1:
  20.     cmpi.b #$64,$dff006
  21.     bne vposr1
  22. vposr2:
  23.     cmpi.b #$0a,$dff006
  24.     bne vposr2
  25.     bsr jump1
  26.     bsr movestars
  27.     bsr jump1
  28.     bsr bouncetext
  29.     btst #6,$bfe001
  30.     bne vposr1
  31. endroutine:
  32.  
  33.  
  34.     move.l $0104,$dff080
  35.     clr.w $dff088
  36.     move.w #$83a0,$dff096
  37.     
  38.     move.l $4,a6
  39.     move.l gfxbase,a1
  40.     jsr -414(a6)
  41.     movem.l (a7)+,d0-d7/a0-a6
  42.     clr.l d0
  43.     rts
  44. clearscreen:
  45.     move.l $0108,a0
  46.     lea -16384(a0),a0
  47.     move.w #$2fff,d0
  48. loop:    clr.l (a0)+
  49.     dbf d0,loop
  50.     sub.w #$1000,a0
  51.     move.l a0,$010c
  52.     sub.w #$1000,a0
  53.     move.l a0,$0114
  54.     rts
  55. init2:
  56.     move.l $0100,a6
  57.     move.l $010c,a1
  58.     clr.l $0110
  59.     jsr -198(a6)
  60.     move.l 148(a6),52(a1)
  61.     move.w #$0008,58(a1)
  62.     move.w #$0004,28(a1)
  63.     lea 128(a1),a0
  64.     move.l a0,4(a1)
  65.     moveq #$01,d0
  66.     move.w #$2a0,d1
  67.     move.w #$00c8,d2
  68.     jsr -390(a6)
  69.     move.l #$68000,136(a1)
  70.     rts
  71. unknown:
  72.     move.l $010c,a1
  73.     lea text(pc),a0
  74.     move.w (a0)+,d0   *get character from scrolltext
  75.     tst.b (a0,d0.w)   *test for zero ?
  76.     bne.s skip
  77.     clr.w -(a0)
  78.     bra unknown
  79. skip:
  80.     addq.w #1,-2(a0)    * this is the text pointer
  81.     adda.w d0,a0
  82.     moveq #$01,d0
  83.     move.w #$0140,36(a1)
  84.     move.w #$004e,38(a1)
  85.     bsr skip2
  86.     move.w #$0290,36(a1)
  87.     bsr skip2
  88.     cmpi.b #$a0,(a0)     *I think this produces gap in scroll
  89.     beq gap
  90.     move.b #$08,$0110
  91.     rts
  92. gap:
  93.     move.b #$f8,$0110
  94.     rts
  95. skip2:
  96.     movem.l a0-a1/d0,-(a7)
  97.     jsr -60(a6)          * text()
  98.     movem.l (a7)+,a0-a1/d0
  99.     rts
  100. jump1:
  101.     tst.b $0110
  102.     bne skip3
  103.     bsr unknown
  104. skip3:
  105.     subq.b #1,$0110        * this value should be 1/text width
  106.     lea $69a40,a0
  107. qqqq2:    moveq #$0f,d0
  108. qqqq1:    moveq #$13,d1
  109.     lsl.w -(a0)
  110. qqqq:    roxl.w -(a0)
  111.     dbf d1,qqqq
  112.     dbf d0,qqqq1
  113.     rts
  114. init3:
  115.     move.l $0114,a0
  116.     clr.l d6
  117.     lea $fd0003,a1
  118.     move.w #$00ff,d0    * number of stars i think
  119.     move.l #$30003100,d1
  120. blug:    move.l d1,(a0)
  121.     move.b (a1),d6
  122.     move.b 6(a1),d5
  123.     eor.b d5,d6
  124.     adda.w #$0004,a1    * i think this is the y add for stars
  125.     lsl.l #8,d6
  126.     lsl.l #8,d6
  127.     addi.l #$00200000,d6    * or may be this/ should be 200000
  128.     andi.l #$00ff0000,d6
  129.     or.l d6,(a0)+
  130.     lsr.l #8,d6
  131.     lsr.l #8,d6
  132.     cmpi.w #$0001,$0118
  133.     beq wow
  134.     cmpi.w #$0002,$0118
  135.     beq wow1
  136.     cmpi.w #$0003,$0118
  137.     beq wow3
  138.     clr.w $118
  139. wow3:    move.l #$00010001,(a0)+
  140.     bra skip4
  141. wow:    move.l #$00000001,(a0)+
  142.     bra skip4
  143. wow1:    move.l #$00010000,(a0)+
  144. skip4:    addi.l #$02000200,d1    * should be 2000200
  145.     bcc bone
  146.     ori.b #$06,d1
  147. bone:
  148.     addi.w #$0002,$0118    * should be 1
  149.     dbf d0,blug        
  150.     clr.l (a0)+
  151.     rts
  152.  
  153. movestars:
  154.     move.l $0114,a0
  155.     move.w #$0020,d0
  156. quicky:    subq.b #1,1(a0)        
  157.     subq.b #2,25(a0)
  158.     subq.b #3,9(a0)
  159.     subq.b #4,17(a0)
  160.     adda.w #$0020,a0    * move pointer to next sprite
  161.     dbf d0,quicky
  162.     rts
  163. bouncetext:
  164.     lea sintable(pc),a0
  165.     move.w $0112,d0
  166.     move.b (a0,d0.w),d0
  167.     bne bouncescroll
  168.     clr.w $0112
  169.     bra bouncetext
  170.     
  171. bouncescroll:
  172.     lea copper2(pc),a0
  173.     move.w #$7652,d1
  174.     subi.b #$80,d0
  175.     mulu #$002a,d0
  176.     add.w d1,d0
  177.     addi.w #$002a,d0
  178.     move.w d0,d2
  179.     move.w #$ff,d3
  180.     sub.w d2,d3
  181.     move.w d3,14(a0)
  182.     move.w d0,6(a0)        * this was d0
  183.     addq.w #1,$0112        * pointer for sin table
  184.     rts
  185.     even
  186.  
  187. copper:
  188.  dc.w $0100,$2200,$0102,$0020,$0104,$0000,$0108,$0002
  189.  dc.w $010a,$0002,$008e,$1800,$0090,$40ff,$0092,$0038
  190.  dc.w $0094,$00d0
  191. copper2:
  192.  
  193.  dc.w $00e0,$0006,$00e2,$8000,$00e4,$0006
  194.  dc.w $00e6,$8000,$0180,$0000,$0182,$0100,$0184,$0010
  195.  dc.w $0186,$0000,$01a0,$0000,$01a2,$0fff,$01a4,$0ddd
  196.  dc.w $01a6,$0bbb,$0120,$0006,$0122,$e000,$0124,$0000
  197.  dc.w $0126,$0000,$0128,$0000,$012a,$0000,$012c,$0000
  198.  dc.w $012e,$0000,$0130,$0000,$0132,$0000,$0134,$0000
  199.  dc.w $0136,$0000,$0138,$0000,$013a,$0000,$013c,$0000
  200.  dc.w $013e,$0000
  201. scroll1:
  202.  dc.w $620f,$fffe,$0182,$0f00,$0184,$00f0,$6a0f,$fffe,$0182,$0f00,$0184,$00f0
  203.  dc.w $740f,$fffe,$0182,$0e00,$0184,$00e0,$7a0f,$fffe,$0182,$0d00,$0184,$00d0
  204.  dc.w $840f,$fffe,$0182,$0c00,$0184,$00c0,$8a0f,$fffe,$0182,$0b00,$0184,$00b0
  205.  dc.w $8e0f,$fffe,$0182,$0a00,$0184,$00a0,$900f,$fffe,$0182,$0900,$0184,$0090
  206.  dc.w $940f,$fffe,$0182,$0800,$0184,$0080,$9a0f,$fffe,$0182,$0700,$0184,$0070
  207.  dc.w $a40f,$fffe,$0182,$0600,$0184,$0060,$aa0f,$fffe,$0182,$0500,$0184,$0050
  208.  dc.w $b40f,$fffe,$0182,$0400,$0184,$0040,$ba0f,$fffe,$0182,$0200,$0184,$0020   
  209.      
  210.  dc.w $ffff,$fffe
  211.     even
  212. sintable: 
  213.  dc.b $ff,$fe,$fe,$fd,$fc,$fb,$f9,$f7,$f5,$f2,$ef,$ec,$e9,$e5,$e2
  214.  dc.b $de,$d9,$d5,$d0,$cb,$c6,$c1,$bb,$b6,$b0,$aa,$a4,$9e,$98,$92
  215.  dc.b $8c,$85,$85,$8c,$92,$98,$9e,$a4,$aa,$b0,$b6,$bb,$c1,$c6,$cb
  216.  dc.b $d0,$d5,$d9,$de,$e2,$e5,$e9,$ec,$ef,$f2,$f5,$f7,$f9,$fb,$fc
  217.  dc.b $fd,$fe,$fe,$ff
  218. text:
  219.  
  220.  dc.b ' ....MATRIX OF MATRIX DIVISION SPEAKING.... ',$a0
  221.  dc.b 'HERE IS MY SECOND STAR/COPPER DEMO'
  222.  dc.b $a0
  223.  dc.b 'HI TO OTHER MEMBERS OF MATRIX DIVISION (GREML1N,'
  224.  dc.b ',WILDCAT,UBI KENUBI)..TND,ACCUMULATORS,BARLICK HACKERS'
  225.  dc.b ' AND EVERYBODY ELSE WE KNOW'
  226.  dc.b $a0
  227.      even
  228. start:
  229.     lea grafname(pc),a1
  230.     move.l $4,a6
  231.     moveq #$00,d0
  232.     jsr -408(a6)
  233.     move.l d0,gfxbase
  234.     rts
  235.      even
  236. grafname: dc.b 'graphics.library',0,0
  237.      even
  238. gfxbase: dc.l 0      
  239.  
  240.